package com.common.utils;

import android.graphics.Bitmap;
import android.graphics.BitmapFactory;

import java.io.File;

public class ImageCompress {

    static {
        System.loadLibrary("imagecompress");
    }

    public static void compressImage(File file) {
        Bitmap bm = BitmapFactory.decodeFile(file.getAbsolutePath());
        if(bm != null) {
            nativeCompressBitmap(bm, 100, file.getAbsolutePath());
        }
    }


    public static native int nativeCompressBitmap(Bitmap bitmap, int quality, String destFile);
}
